package com.ekalenchuk.module.utils;

import java.io.Serializable;

import com.ekalenchuk.module.domain.Article;
import com.ekalenchuk.module.dto.article.ArticleDTO;

public class ConvertUtils implements Serializable {
	private static final long serialVersionUID = 8264001436858475941L;

	public static Article convertArticleDtoToArticle(final ArticleDTO dto) {
		Article article = new Article();
		article.setTitle(dto.getTitle());
		article.setText(dto.getText());
		article.setTags(dto.getTags());
		return article;
	}
	
	public static ArticleDTO convertArticleToArticleDTO(final Article article) {
		ArticleDTO dto = new ArticleDTO();
		dto.setTitle(article.getTitle());
		dto.setText(article.getText());
		dto.setTags(article.getTags());
		return dto;
	}
}
